package com.laitaoo.views.main
{
	import com.laitaoo.event.HomeEvent;
	import com.laitaoo.views.BaseMediator;

	[Component]
	public class MainMediator extends BaseMediator
	{
		public function MainMediator()
		{
		}
		
		/**
		 *是否显示登录页面
		 **/
		[Bindable]
		public var isShowLogin:Boolean = true;
		
		/**
		 * 用户登录返回结果
		 **/
		[EventHandler()]
		public function loginResultHandler():void{
			
			isShowLogin = false;
			
			// 派发加载导航树的事件
			var homeEvent:HomeEvent = new HomeEvent(HomeEvent.TREE_DATA);
			eventBus.dispatchEvent(homeEvent);
			
			//获取种类
			var homeEvent1:HomeEvent = new HomeEvent(HomeEvent.GETPRODUCTKINDS);
			eventBus.dispatchEvent(homeEvent1);
		}
	}
}